<?php

namespace common\models;

use Yii;
use common\widgets\webuploader\UploaderBehavior;

/**
 * This is the model class for table "article_test".
 *
 * @property integer $id
 * @property string $title
 * @property string $content
 * @property string $thum_addr
 * @property string $img_list_addr
 * @property string $file_addr
 * @property string $file_list_addr
 * @property integer $create_at
 * @property integer $updated_at
 */
class ArticleTest extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'article_test';
    }
    
    public function behaviors()
    {
        return [
            [
                'class' => UploaderBehavior::className(),
                'attribute' => 'thum_addr,img_list_addr,file_addr,file_list_addr',
            ],
        ];
    }
    
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title'], 'required'],
            [['create_at', 'updated_at'], 'integer'],
            [['content', 'img_list_addr', 'file_list_addr'], 'string'],
            [['title'], 'string', 'max' => 80],
            [['thum_addr', 'file_addr'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => '标题',
            'content' => '内容',
            'thum_addr' => '单图',
            'img_list_addr' => '多图',
            'file_addr' => '单文件',
            'file_list_addr' => '多文件',
            'create_at' => '创建时间',
            'updated_at' => '修改时间',
        ];
    }
}
